package com.hq.fxh.No3_TuiGuang.Fragment;


import android.support.v4.app.Fragment;
import android.view.View;

import com.hq.fxh.No0_ChengQu.Fragment.BaseFragment;
import com.hq.fxh.R;
import com.hq.fxh.Utils.SharedPreferenceUtils;


/**
 * A simple {@link Fragment} subclass.
 * 推广frament
 */
public class Fragment_TuiGuang extends BaseFragment {

    private Tg_GeRen_Fragment promotionFragment;
    private Fragment_Qiye_Kuangjia businessPromotionFragment;
    private int isCompany;


    @Override
    public int getLayoutId() {
        return R.layout.fragment_info;
    }

    @Override
    protected void findView(View view) {

    }

    @Override
    protected void initData() {


        promotionFragment = new Tg_GeRen_Fragment();
        businessPromotionFragment = new Fragment_Qiye_Kuangjia();
        isCompany = SharedPreferenceUtils.getIsCompany(getContext());
        if (isCompany ==0) {
             tran(false);
        } else {
            tran(true);
        }
    }

    public void tran(boolean isCompany) {

        if (isCompany) {
            getChildFragmentManager().beginTransaction().replace(R.id.content, businessPromotionFragment).commitAllowingStateLoss();
        } else {
            getChildFragmentManager().beginTransaction().replace(R.id.content, promotionFragment).commitAllowingStateLoss();
        }
    }


}
